<?php

namespace app\common\Validate;

use think\Validate;

class AddressValidate extends Validate
{
	
	/**
	 * 验证规则
	 * @var [array]
	 */
	protected $rule = [
        'id|地址id' => 'require',
        'addressInfo|地址信息' => 'require',
        'detailed|详细地址' => 'require',
        'consignee|收货人' => 'require',
        'phone|手机号' => 'require|mobile',
    ];


    /**
     * 添加
     * @Author   Yichen
     * @DateTime 2020-05-02T13:43:52+0800
     * @return   [type]                   [description]
     */
    public function sceneAdd()
    {
    	return $this->only(['addressInfo', 'detailed', 'consignee', 'phone']);
    }

    /**
     * 删除
     * @Author   Yichen
     * @DateTime 2020-05-07T21:48:50+0800
     * @return   [type]                   [description]
     */
    public function sceneDel()
    {
        return $this->only(['id']);
    }

    /**
     * 设置
     * @Author   Yichen
     * @DateTime 2020-05-07T22:25:11+0800
     * @return   [type]                   [description]
     */
    public function sceneSet()
    {
        return $this->only(['id']);
    }
}